package com.example.alibabanacosdiscoveryserver;

import com.example.alibabanacosdiscoveryserver.service.AirQualityService;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;

@EnableDiscoveryClient
@SpringBootApplication
@EnableKnife4j
public class AlibabaNacosDiscoveryServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(AlibabaNacosDiscoveryServerApplication.class, args);
    }
    @Bean
    public ToolCallbackProvider calculateTools(AirQualityService climateService) {
        return MethodToolCallbackProvider.builder().toolObjects(climateService).build();
    }
}
